package client.control;


import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import net.miginfocom.swing.MigLayout;
import javax.swing.SwingConstants;


public class JaNeinDialog extends JDialog {

	private final JPanel contentPanel = new JPanel();
	private MainScroll mainscr;

	/**
	 * Create the dialog.
	 */
	public JaNeinDialog(final MainScroll mainscr, final int artNr, final int row) {
		setBounds(100, 100, 257, 122);
		getContentPane().setLayout(new MigLayout("", "[]", "[][]"));
		
		JLabel lblMchtenSieDen = new JLabel("Moechten Sie Artikel Nummer " + artNr + " loeschen?");
		getContentPane().add(lblMchtenSieDen, "cell 0 0");
		
		JButton btnOk = new JButton("Ja");
		btnOk.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				mainscr.artikelLoeschen(artNr, row);
				dispose();
			}
		});
		getContentPane().add(btnOk, "flowx,cell 0 1");
		
		
		JButton btnCancel = new JButton("Nein");
		btnCancel.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				dispose();
			}
		});
		getContentPane().add(btnCancel, "cell 0 1");
		
		
	}

}
